import React from 'react'
import { isLogin } from '@/utils'
import { Outlet, Navigate, useLocation } from 'umi'
export default function index() {
  const location = useLocation();
  return (
    <>
      {
        isLogin()
        ?
        <Outlet/>
        :
        <Navigate to="/login" state={{from: location.pathname}}/>
      }
    </>
  )
}
